package com.wowoai.admin.useroption.controller;

import com.wowoai.admin.useroption.controller.req.AdminUserOptionReq;
import com.wowoai.admin.useroption.service.AdminUserOptionServiceI;
import com.wowoai.common.response.ResponseVO;
import com.wowoai.common.userInfo.CurrentUserInfo;
import com.wowoai.common.userInfo.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 去除水印控制器
 */
@Slf4j
@RestController
@RequestMapping("/userOption")
public class AdminUserOptionController {

    @Autowired
    private AdminUserOptionServiceI userOptionServiceI;

    /**
     * 操作用户永久积分
     * @param userOptionReq
     * @return
     */
    @PostMapping("/permanentScore")
    public ResponseVO<Void> removeWatermark(@RequestBody AdminUserOptionReq userOptionReq) {
        UserInfo userInfo = CurrentUserInfo.getUserInfo();
        userOptionServiceI.permanentScore(userInfo,userOptionReq.getOptionUserId(),userOptionReq.getPermanentScoreOpt());
        return ResponseVO.success(null);
    }
}
